var assert = require('assert');
var should = require('should');
var util = require('util');
var zlib = require('zlib');
var _ = require('lodash');
var taskService = require('../../app/services/taskService');
var config = require('../config');
var dataApi = require('../../app/libs/dataApi');
var taskModel = require('../../app/models/taskModel');
var PlayerManager = require('../../app/libs/playerManager');
var taskFactory = require('../../app/libs/taskFactory');
var taskType = require('../../app/consts/taskType');

suite('测试taskService', function () {
    var player_manager = new PlayerManager(config.role_id);
    setup(function (done) {
        player_manager.getModel(['task', 'achieve', 'daily_task'], done);
    });

    // suite('addTotalGold', function () {
    //     test('TOTAL_GOLD: 1', function (done) {
    //         taskService.addTotalGold(player_manager, 10000);
    //         taskFactory.getInstance(taskType.TOTAL_GOLD).getProgress({});
    //         player_manager.save(done);
    //     });
    // });

    // suite('addTotalDiamond', function () {
    //     test('TOTAL_DIAMOND: 2', function () {
    //         taskService.addTotalDiamond(player_manager, 10000);
    //         taskFactory.getInstance(taskType.TOTAL_DIAMOND).getProgress({});
    //     });
    // });

    // suite('addStar3Copy', function () {
    //     test('STAR_3_COPY: 3', function () {
    //         taskService.addStar3Copy(player_manager, 10000);
    //         taskFactory.getInstance(taskType.STAR_3_COPY).getProgress({});
    //     });
    // });

    // suite('addUpgradeNexusNum', function () {
    //     test('UPGRADE_CHEST_NUM: 4', function () {
    //         taskService.addUpgradeNexusNum(player_manager, 201, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_CHEST_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addHeroLv', function () {
    //     test('HERO_LV: 5', function (done) {
    //         taskService.addHeroLv(player_manager, 10000);
    //         taskFactory.getInstance(taskType.HERO_LV).getProgress({});
    //         player_manager.save(done);
    //     });
    // });

    // suite('addBattleNum', function () {
    //     test('BATTLE_NUM: 6', function () {
    //         taskService.addBattleNum(player_manager);
    //         taskFactory.getInstance(taskType.BATTLE_NUM).getProgress({});
    //     });
    // });

    // suite('addBattleWinNum', function () {
    //     test('BATTLE_WIN_NUM: 7', function () {
    //         taskService.addBattleWinNum(player_manager);
    //         taskFactory.getInstance(taskType.BATTLE_WIN_NUM).getProgress({});
    //     });
    // });

    // suite('addBattleEarnTotalGold', function () {
    //     test('BATTLE_EARN_TOTAL_GOLD: 8', function () {
    //         taskService.addBattleEarnTotalGold(player_manager, 10000);
    //         taskFactory.getInstance(taskType.BATTLE_EARN_TOTAL_GOLD).getProgress({});
    //     });
    // });

    // suite('addBattleEarnGoldOneTime', function () {
    //     test('BATTLE_EARN_GOLD_ONE_TIME: 9', function () {
    //         taskService.addBattleEarnGoldOneTime(player_manager, 10000);
    //         taskFactory.getInstance(taskType.BATTLE_EARN_GOLD_ONE_TIME).getProgress({});
    //     });
    // });

    // suite('addBattleDefWinNum', function () {
    //     test('BATTLE_DEF_WIN_NUM: 10', function () {
    //         taskService.addBattleDefWinNum(player_manager);
    //         taskFactory.getInstance(taskType.BATTLE_DEF_WIN_NUM).getProgress({});
    //     });
    // });

    // suite('addUpgradeSoldierNum', function () {
    //     test('UPGRADE_SOLDIER_NUM: 11', function () {
    //         taskService.addUpgradeSoldierNum(player_manager);
    //         taskFactory.getInstance(taskType.UPGRADE_SOLDIER_NUM).getProgress({}, {});
    //     });
    // });

    // suite('addSoldierTrainLv', function () {
    //     test('TRAIN_LV: 12', function () {
    //         taskService.addSoldierTrainLv(player_manager, 10000);
    //         taskFactory.getInstance(taskType.TRAIN_LV).getProgress({});
    //     });
    // });

    // suite('addUnlockSkillSelect', function () {
    //     test('UNLOCK_SKILL_SELECT: 13', function () {
    //         taskService.addUnlockSkillSelect(player_manager);
    //         taskFactory.getInstance(taskType.UNLOCK_SKILL_SELECT).getProgress({});
    //     });
    // });

    // suite('addUnlockSoldierSelect', function () {
    //     test('UNLOCK_SOLDIER_SELECT: 14', function () {
    //         taskService.addUnlockSoldierSelect(player_manager);
    //         taskFactory.getInstance(taskType.UNLOCK_SOLDIER_SELECT).getProgress({});
    //     });
    // });

    // suite('addHeroSkillLv', function () {
    //     test('HERO_SKILL_LV: 15', function () {
    //         taskService.addHeroSkillLv(player_manager, 10000);
    //         taskFactory.getInstance(taskType.HERO_SKILL_LV).getProgress({});
    //     });
    // });

    // suite('addUnlockTower', function () {
    //     test('UNLOCK_TOWER: 16', function () {
    //         taskService.addUnlockTower(player_manager, 10000);
    //         taskFactory.getInstance(taskType.UNLOCK_TOWER).getProgress({});
    //     });
    // });

    // suite('addClearRuinNum', function () {
    //     test('CLEAR_RUIN_NUM: 17', function () {
    //         taskService.addClearRuinNum(player_manager, 10000);
    //         taskFactory.getInstance(taskType.CLEAR_RUIN_NUM).getProgress({});
    //     });
    // });

    // suite('addCupNum', function () {
    //     test('CUP_NUM: 18', function () {
    //         taskService.addCupNum(player_manager, 10000);
    //         taskFactory.getInstance(taskType.CUP_NUM).getProgress({});
    //     });
    // });

    // suite('addProtectTime', function () {
    //     test('PROTECT_TIME: 19', function () {
    //         taskService.addProtectTime(player_manager, 10000);
    //         taskFactory.getInstance(taskType.PROTECT_TIME).getProgress({});
    //     });
    // });

    // suite('addRank', function () {
    //     test('RANK: 20', function () {
    //         taskService.addRank(player_manager, 10000);
    //         taskFactory.getInstance(taskType.RANK).getProgress({});
    //     });
    // });

    // suite('addtaskMine', function () {
    //     test('UPGRADE_MINE_NUM: 21', function () {
    //         taskService.addtaskMine(player_manager, 202, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_MINE_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskChest', function () {
    //     test('UPGRADE_CHEST_NUM: 22', function () {
    //         taskService.addtaskChest(player_manager, 203, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_CHEST_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskFarm', function () {
    //     test('UPGRADE_FARM_NUM: 23', function () {
    //         taskService.addtaskFarm(player_manager, 204, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_FARM_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskBarn', function () {
    //     test('UPGRADE_BARN_NUM: 24', function () {
    //         taskService.addtaskBarn(player_manager, 205, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_BARN_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskParade', function () {
    //     test('UPGRADE_PARADE_NUM: 25', function () {
    //         taskService.addtaskParade(player_manager, 207, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_PARADE_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskAirship', function () {
    //     test('UPGRADE_AIRSHIP_NUM: 26', function () {
    //         taskService.addtaskAirship(player_manager, 208, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_AIRSHIP_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskSmithy', function () {
    //     test('UPGRADE_SMITHY_NUM: 28', function () {
    //         taskService.addtaskSmithy(player_manager, 211, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_SMITHY_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskWall', function () {
    //     test('UPGRADE_WALL_NUM: 29', function () {
    //         taskService.addtaskWall(player_manager, 212, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_WALL_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskMarchhall', function () {
    //     test('UPGRADE_MARCHHALL_NUM: 30', function () {
    //         taskService.addtaskMarchhall(player_manager, 213, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_MARCHHALL_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskAtelier', function () {
    //     test('UPGRADE_ATELIER_NUM: 31', function () {
    //         taskService.addtaskAtelier(player_manager, 214, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_ATELIER_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskHerocollege', function () {
    //     test('UPGRADE_HEROCOLLEGE_NUM: 32', function () {
    //         taskService.addtaskHerocollege(player_manager, 215, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_HEROCOLLEGE_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskSoldiercollege', function () {
    //     test('UPGRADE_SOLDIERCOLLEGE_NUM: 33', function () {
    //         taskService.addtaskSoldiercollege(player_manager, 216, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_SOLDIERCOLLEGE_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskAcademy', function () {
    //     test('UPGRADE_ACADEMY_NUM: 34', function () {
    //         taskService.addtaskAcademy(player_manager, 217, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_ACADEMY_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskWishtree', function () {
    //     test('UPGRADE_WISHTREE_NUM: 35', function () {
    //         taskService.addtaskWishtree(player_manager, 218, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_WISHTREE_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addPassCopy', function () {
    //     test('PASS_COPY: 101', function () {
    //         taskService.addPassCopy(player_manager, 10000);
    //         taskFactory.getInstance(taskType.PASS_COPY).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addPassCopyNum', function () {
    //     test('PASS_COPY_NUM: 202', function () {
    //         taskService.addPassCopyNum(player_manager, 10000);
    //         taskFactory.getInstance(taskType.PASS_COPY_NUM).getProgress({});
    //         player_manager.save();
    //     });
    // });

    // suite('addRankFightNum', function () {
    //     test('RANK_FIGHT_NUM: 203', function () {
    //         taskService.addRankFightNum(player_manager, 10000);
    //         taskFactory.getInstance(taskType.RANK_FIGHT_NUM).getProgress({});
    //         player_manager.save();
    //     });
    // });

    // suite('addCompose', function () {
    //     test('COMPOSE: 204', function () {
    //         taskService.addCompose(player_manager, 10000);
    //         taskFactory.getInstance(taskType.COMPOSE).getProgress({});
    //         player_manager.save();
    //     });
    // });

    // suite('addEquipUpgrade', function () {
    //     test('EQUIP_UPGRADE: 205', function () {
    //         taskService.addEquipUpgrade(player_manager, 10000);
    //         taskFactory.getInstance(taskType.EQUIP_UPGRADE).getProgress({});
    //         player_manager.save();
    //     });
    // });

    // suite('addEquipReset', function () {
    //     test('EQUIP_RESET: 206', function () {
    //         taskService.addEquipReset(player_manager, 10000);
    //         taskFactory.getInstance(taskType.EQUIP_RESET).getProgress({});
    //         player_manager.save();
    //     });
    // });

    // suite('addWorldBossNum', function () {
    //     test('WORLD_BOSS_NUM: 207', function () {
    //         taskService.addWorldBossNum(player_manager, 10000);
    //         taskFactory.getInstance(taskType.WORLD_BOSS_NUM).getProgress({});
    //         player_manager.save();
    //     });
    // });

    // suite('addBuyMarket', function () {
    //     test('RECEIVE_MARKET_NUM: 228 ', function () {
    //         taskService.addBuyMarket(player_manager);
    //         taskFactory.getInstance(taskType.RECEIVE_MARKET_NUM).getProgress({});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskBarrack', function () {
    //     test('UPGRADE_BARRACK_NUM: 41', function () {
    //         taskService.addtaskBarrack(player_manager, 101, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_BARRACK_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskDefense', function () {
    //     test('UPGRADE_DEFENSE_NUM: 42', function () {
    //         taskService.addtaskDefense(player_manager, 107, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_DEFENSE_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskRoadBlock', function () {
    //     test('UPGRADE_ROAD_BLOCK_NUM: 43', function () {
    //         taskService.addtaskRoadBlock(player_manager, 112, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_ROAD_BLOCK_NUM).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });

    // suite('addtaskUpgradeRoad', function () {
    //     test('UPGRADE_LANDMINE: 44', function () {
    //         taskService.addtaskUpgradeRoad(player_manager, 113, 10);
    //         taskFactory.getInstance(taskType.UPGRADE_LANDMINE).getProgress({}, {});
    //         player_manager.save();
    //     });
    // });
});
